package net.contrend.system.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import net.contrend.system.form.UserForm;

public class UserFormMapper implements RowMapper {

    @Override
    public Object mapRow(ResultSet rs, int index) throws SQLException {
        UserForm user = new UserForm();
        user.setUserId(rs.getString("userId"));
        user.setLoginName(rs.getString("loginName"));
        user.setLoginPassword(rs.getString("loginPassword"));
        user.setUserName(rs.getString("userName"));
        user.setGender(rs.getString("gender"));
        user.setMobile(rs.getString("mobile"));
        user.setTelephone(rs.getString("telephone"));
        user.setDeptId(rs.getString("deptId"));
        user.setStatus(rs.getString("status"));
        user.setOrderNo(rs.getInt("orderNo"));
        user.setRemark(rs.getString("remark"));
        user.setLastVisitIp(rs.getString("lastVisitIp"));
        
        java.sql.Date date = rs.getDate("lastVisittime");
        user.setLastVisitTime(null == date ? null : new java.util.Date(date.getTime()));
        return user;
    }

}
